package org.jma.lib.soap;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;

import org.dangoldberg.app.http.Plugin;
import org.jma.lib.soap.exceptions.HttpException;


public class SOAPApplication extends HashMap implements Plugin {




	private boolean _debug=true;
	private SOAPProxy soapProxy = new SOAPProxy(this);
	
	
	
		
	protected SOAPProxy getSOAPProxy(){
		return soapProxy;
	}
		
		
	public String doGet(
			HttpRequest request, HttpResponse response)
			throws HttpException, IOException {
		return doPost(request, response);
	}

	public String doPost(
		HttpRequest request, HttpResponse response)
		throws HttpException, IOException {

		String WsdlRequest=request.getParameter("wsdl");
		if (WsdlRequest==null){ 	
			String sb= soapProxy.processSoapCall(request,response);
			if (_debug) System.out.println(sb);
			return sb;
		}
		else{
			soapProxy.getWsdl();		
		}
		return "";
}	
	
}

